package com.warm.base.design.b_memento.self;

/**
 * @Date: 2019/11/28 10:37
 * @Author: LChuang
 * @Description:
 */
public class SOriginator {

    public String state;

    public void setState(String state){
        this.state = state;
    }

    public SMemento createSMemento(){
        return new SMemento(this);
    }

    public void restoreSMemento(ISMemento memento){
        SMemento m = (SMemento) memento;
        setState(m.getState());
    }

    @Override
    public String toString() {
        return "SOriginator{" +
                "state='" + state + '\'' +
                '}';
    }
}
